com.highdeal.hci
Class MessageHeader

java.lang.Object
  extended by com.highdeal.hci.MessageHeader
All Implemented Interfaces:
XMLMarshallable

public class MessageHeader
extends java.lang.Object
implements XMLMarshallable

This Java class represents the header of a message sent via HCI sent by your client application to a connected SAP CC Core Server system; It includes information about the message originator and specifies the processing mode (TRANSACTION_ALL) of the operation requests that are included in the sent message body.

The message header MessageHeader contains:

Important Note

Make sure you specify the transaction mode that is relevant with your business requirements.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="header">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="originator" minOccurs="0" maxOccurs="1"/>
     </xs:sequence>
     <xs:attribute name="transaction" type="TransactionBehaviorType" default="all"/>
   </xs:complexType>
 </xs:element>

 <xs:simpleType name="TransactionBehaviorType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="all"/>
     <xs:enumeration value="firstFail"/>
     <xs:enumeration value="most"/>
     <xs:enumeration value="try"/>
   </xs:restriction>
 </xs:simpleType>


Nested Class Summary
static class MessageHeader.TransactionMode
          This enumeration lists the transaction modes used by the SAP CC system to process the received operation messages and the service operations that are included in these message envelopes.
 
Field Summary
static MessageHeader.TransactionMode TRANSACTION_ALL
          In this transaction mode, all or none of the operations are executed by the SAP CC system.
static MessageHeader.TransactionMode TRANSACTION_FIRST_FAIL
          In this transaction mode, all operations are executed until the first that fails.
static MessageHeader.TransactionMode TRANSACTION_MOST
          In this transaction mode, the operations are executed even if some of them failed.
static MessageHeader.TransactionMode TRANSACTION_TRY
          In this transaction model, no operation is executed, they are only tried.
 
Constructor Summary
MessageHeader()
           
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 MessageOriginator getOriginator()
          Returns the originator of this header.
 MessageHeader.TransactionMode getTransactionMode()
          Returns the processing mode of the operation requests included in the message body.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag being processed.
 void setOriginator(MessageOriginator o)
          Sets the originator (your client application) for this message.
 void setTransactionMode(MessageHeader.TransactionMode mode)
          Sets the processing mode of the operation requests included in the message body; The connected SAP CC system receives the message and manages the requests depending on this execution mode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSACTION_ALL

public static final MessageHeader.TransactionMode TRANSACTION_ALL
In this transaction mode, all or none of the operations are executed by the SAP CC system.


TRANSACTION_FIRST_FAIL

public static final MessageHeader.TransactionMode TRANSACTION_FIRST_FAIL
In this transaction mode, all operations are executed until the first that fails.


TRANSACTION_MOST

public static final MessageHeader.TransactionMode TRANSACTION_MOST
In this transaction mode, the operations are executed even if some of them failed.


TRANSACTION_TRY

public static final MessageHeader.TransactionMode TRANSACTION_TRY
In this transaction model, no operation is executed, they are only tried.

Constructor Detail

MessageHeader

public MessageHeader()
Method Detail

getTransactionMode

public MessageHeader.TransactionMode getTransactionMode()
Returns the processing mode of the operation requests included in the message body.

Returns:
The transaction mode specified in this header

setTransactionMode

public void setTransactionMode(MessageHeader.TransactionMode mode)
Sets the processing mode of the operation requests included in the message body; The connected SAP CC system receives the message and manages the requests depending on this execution mode.

The available operation processing modes are:

Parameters:
mode - The execution mode for the operation requests
See Also:
MessageHeader.TransactionMode

getOriginator

public MessageOriginator getOriginator()
Returns the originator of this header.

Returns:
The originator of this message

setOriginator

public void setOriginator(MessageOriginator o)
Sets the originator (your client application) for this message.

Parameters:
o - The originator of this message

setAttributes

public void setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the tag being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current tag

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Gives an XML representation of this object, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)